/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#settings-view {
  background-color: #5d9bc7;
  height: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

#settings-view.dark {
  background-color: #305067;
  z-index: 50;
}

.section-title.hidden {
  display: none;
}

.section-title {
  width: 100%;
  text-align: center;
  height: 9.6rem;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 10;
}

.section-title-container {
  white-space: nowrap;
  color: #fff;
  text-overflow: ellipsis;
  height: 100%;
  line-height: 9.6rem;
}

.section-title-icon {
  height: 4rem;
  position: relative;
  top: 1.3rem;
  padding-right: 0.5rem;
}

.section-title-name {
  font-size: 1.6rem;
}

.section-title-back-flex,
.section-title-right-flex {
  flex: 1;
  min-width: 9.6rem;
  flex-shrink: 0;
  height: 9.6rem;
}

.section-title-right-flex {
  flex: 1;
  min-width: 0;
}

#settings-menu ul {
  box-sizing: border-box;
  width: 100%;
  max-width: 60rem;
  margin: 0 auto;
  padding: 2rem;
  padding-top: 0;
}

#settings-back-button {
  background-color: transparent;
}

.developer-link-item,
.settings-item {
  margin: 0;
  padding: 0;
  list-style-type: none;
  background-color: #5288af;
  border-radius: 0.5rem;
  background-image: url('/images/right-arrow.png');
  background-size: auto 2rem;
  background-repeat: no-repeat;
  background-position: right 2.8rem center;
}

.developer-link-item a,
.settings-item a {
  display: block;
  margin: 1rem 0;
  padding: 2rem 2rem 2rem 5.5rem;
  color: #fff;
  text-decoration: none;
  font-size: 1.8rem;
  background-position: 1rem;
  background-size: 3.2rem;
  background-repeat: no-repeat;
  outline: 0;
}

#domain-settings-link {
  background-image: url('/images/domain-icon.png');
}

#domain-settings-local-link {
  background-image: url('/images/domain-icon.png');
}

#domain-settings-mozilla-link {
  background-image: url('/images/domain-icon.png');
}

#network-settings-link {
  background-image: url('/images/network.svg');
}

#user-settings-link {
  background-image: url('/images/users-icon.png');
}

#adapter-settings-link {
  background-image: url('/images/adapters-icon.png');
}

#addon-settings-link {
  background-image: url('/images/add-on.svg');
}

#experiment-settings-link {
  background-image: url('/images/experiments-icon.png');
}

#localization-settings-link {
  background-image: url('/images/localization-icon.svg');
}

#update-settings-link {
  background-image: url('/images/update-icon.svg');
}

#authorization-settings-link {
  background-image: url('/images/authorization.svg');
}

#developer-settings-link {
  background-image: url('/images/developer-icon.svg');
}

.settings-section {
  position: absolute;
  top: 50%;
  transform: translate(0%, -50%);
  display: block;
  width: 100%;
  height: 100%;
  transition: transform 0.25s ease;
  padding: 0;
  padding-bottom: 9.6rem;
  box-sizing: border-box;
  overflow-y: auto;
}

.settings-subsection {
  display: block;
  overflow-y: auto;
}

.settings-section.hidden {
  transform: translate(100%, -50%);
}

#settings-menu.hidden {
  transform: translate(-100%, -50%);
}

.settings-subsection.hidden {
  display: none;
}

.settings-container {
  position: relative;
  color: #fff;
  background-color: #48779a;
  border-radius: 0.5rem;
  padding: 2rem;
  color: #fff;
  text-align: left;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.4rem;
  max-width: 60rem;
  margin: 0 auto;
}

.domain-settings-container {
  margin: 0 auto;
  padding-bottom: 1rem;
}

.domain-settings-container:last-child {
  padding-bottom: 0;
}

#network-settings-client ul,
#network-settings-router ul,
#user-settings ul,
#adapter-settings ul,
#addon-settings ul,
#domain-settings ul,
#experiment-settings ul,
#localization-settings ul,
#update-settings ul,
#authorization-settings ul,
#developer-settings ul {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-sizing: border-box;
  width: 100%;
  max-width: 60rem;
  padding: 9.6rem 2rem;
  max-height: 100%;
}

.network-settings-wrap ul {
  box-sizing: border-box;
  width: 100%;
  max-width: 60rem;
  padding: 9.6rem 2rem;
  max-height: 100%;
}

#network-settings-client ul li:last-child,
#network-settings-router ul li:last-child,
.network-settings-wrap ul li:last-child,
#user-settings ul li:last-child,
#adapter-settings ul li:last-child,
#addon-settings ul li:last-child,
#domain-settings ul li:last-child,
#experiment-settings ul li:last-child,
#localization-settings ul li:last-child,
#update-settings ul li:last-child {
  margin-bottom: 3rem;
}

#network-settings-unsupported-text,
#no-experiments,
#no-adapters {
  text-align: center;
  position: relative;
  top: 50%;
  width: calc(100% - 4rem);
  max-width: 60rem;
  margin: 0 auto;
  padding: 2rem;
  color: white;
  font-size: 2rem;
}

#no-experiments,
#no-adapters {
  transform: translateY(calc(-50% - 4.8rem));
}

#network-settings-unsupported-text {
  transform: translateY(calc(-50% - 9.6rem));
}

#no-experiments.hidden,
#no-adapters.hidden,
#no-authorizations.hidden {
  display: none;
}

.developer-checkbox-item,
.experiment-item,
.localization-item,
.update-item,
.authorization-item,
.domain-item {
  display: block;
  margin: 1rem 0;
  font-size: 1.8rem;
  padding: 2rem 2rem 2rem 5.5rem;
  list-style-type: none;
  background-color: #5288af;
  color: #fff;
  border-radius: 0.5rem;
  background-position: 1rem;
  background-size: 3.2rem;
  background-repeat: no-repeat;
}

.network-item,
.wireless-network-item,
.user-item,
.adapter-item,
.addon-item,
.authorization-item,
.discovered-addon-item,
.domain-item {
  display: block;
  font-size: 1.8rem;
  list-style-type: none;
  color: #fff;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.network-item,
.wireless-network-item,
.user-item,
.adapter-item,
.addon-item,
.authorization-item,
.domain-item {
  background-color: #5288af;
}

.network-item {
  display: flex;
}

.network-settings-list-item-icon {
  height: 6rem;
  padding: 2rem 2rem;
}

.network-settings-list-item-container-2,
.network-settings-list-item-container-3 {
  flex: 1;
  height: 6rem;
  line-height: 2rem;
}

.network-settings-list-item-container-2 {
  margin-top: 3rem;
}

.network-settings-list-item-container-3 {
  margin-top: 2rem;
}

.network-settings-list-item-detail {
  color: #ccc;
}

.network-settings-list-item-button {
  background-image: url('/images/settings-icon.png');
  height: 4.2rem;
  margin: 2.9rem 2rem;
}

.domain-item {
  padding: 2rem;
}

.wireless-network-item,
.discovered-addon-item {
  background-color: #597285;
}

.user-settings-header,
.adapter-settings-header,
.addon-settings-header {
  padding: 2rem 2rem 0.5rem 6.5rem;
  background-size: 4rem;
  background-repeat: no-repeat;
  background-position: 1.8rem 2.8rem;
}

.user-settings-header {
  background-image: url('/images/user.svg');
}

.adapter-settings-header {
  background-image: url('/images/adapters-icon.png');
}

.addon-settings-header,
.addon-settings-header.extension {
  background-image: url('/images/add-on.svg');
}

.addon-settings-header.adapter {
  background-image: url('/images/adapters-icon.png');
}

.addon-settings-header.notifier {
  background-image: url('/images/thing-icons/notification.svg');
}

.addon-settings-header.service {
  /* TODO */
}

.user-settings-name,
.adapter-settings-name {
  display: block;
}

.addon-settings-version {
  float: right;
}

.addon-updating {
  margin-right: .8rem;
}

.user-settings-description,
.adapter-settings-description,
.addon-settings-description,
.domain-settings-description {
  display: block;
  color: #ccc;
}

.domain-settings-error {
  color: #ff9955;
  font-size: 1.4rem;
  padding: 0 0 1rem 0;
}

.domain-settings-error.hidden {
  display: none;
}

#domain-settings-local-label {
  display: block;
}

#domain-settings-local-name {
  display: inline-block;
  margin: 1.5rem auto;
}

#domain-settings-local-update {
  display:block;
  font-size: 1.8rem;
}

#domain-settings-tunnel-name {
  font-size: 1.4rem;
}

.addon-settings-license,
.addon-settings-author {
  font-size: 1.4rem;
  font-style: italic;
  color: #ccc;
}

.addon-settings-license {
  padding-left: 0.5rem;
}

.addon-settings-license a:link,
.addon-settings-license a:visited,
.addon-settings-license a:hover,
.addon-settings-license a:active,
.addon-settings-author a:link,
.addon-settings-author a:visited,
.addon-settings-author a:hover,
.addon-settings-author a:active {
  color: #fff;
}

.user-settings-controls,
.adapter-settings-controls,
.addon-settings-controls {
  padding: 0rem 1rem 1rem 1rem;
  text-align: right;
}

.network-settings-list-item-button,
.user-settings-controls button,
.adapter-settings-controls button,
.addon-settings-controls button {
  font-size: 1.8rem;
}

.network-settings-list-item-button,
.user-settings-edit,
.user-settings-remove,
.adapter-settings-disable,
.adapter-settings-enable,
.addon-settings-disable,
.addon-settings-enable,
.addon-discovery-settings-add,
.addon-discovery-settings-installing,
.addon-discovery-settings-install-failed,
.addon-settings-remove {
  background-size: 2rem;
  background-repeat: no-repeat;
  background-position: 0.5em;
  padding-left: 4rem;
}

.network-settings-list-item-button,
.user-settings-edit,
.user-settings-remove,
.adapter-settings-disable,
.adapter-settings-enable,
.addon-settings-config,
.addon-settings-update,
.addon-settings-disable,
.addon-settings-enable,
.addon-settings-remove,
.domain-settings-update {
  background-color: #48779a;
}

.addon-discovery-settings-add {
  background-color: #7f93a1;
}

.addon-settings-config {
  background-size: 2rem;
  background-repeat: no-repeat;
  background-position: 0.5em;
  padding-left: 4rem;
  margin-right: .8rem;
  background-image: url('/images/settings-icon.png');
}

.addon-settings-config.hidden {
  display: none;
}

.addon-settings-update {
  background-size: 2rem;
  background-repeat: no-repeat;
  background-position: 0.5em;
  padding-left: 4rem;
  margin-right: .8rem;
  background-image: url('/images/update-icon.svg');
}

.addon-settings-update.hidden {
  display: none;
}

.adapter-settings-disable,
.addon-settings-disable {
  background-image: url('/images/disable.svg');
}

.adapter-settings-enable,
.addon-settings-enable {
  background-image: url('/images/enable.svg');
}

.user-settings-edit {
  background-image: url('/images/edit-plain.svg');
}

.addon-settings-remove,
.user-settings-remove {
  margin-right: .8rem;
  background-image: url('/images/remove.svg');
}

@media only screen and (max-width: 560px) {
  .addon-settings-spacer {
    display: block;
    margin-top: 1rem;
  }

  .addon-settings-update {
    margin-right: 0;
    margin-left: .8rem;
  }

  .addon-settings-config {
    margin-right: 0;
  }
}

.addon-discovery-settings-add {
  background-image: url('/images/new.svg');
}

#add-user-button,
#discover-addons-button {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background-image: url('/images/add.svg');
}

#user-settings-edit,
#user-settings-add,
#addon-discovery-settings {
  background-color: #305067;
}

.localization-item {
  padding: 1rem 2rem;
  text-align: center;
}

.localization-item-header {
  padding-bottom: 2rem;
}

.localization-item-content {
  width: 100%;
  display: grid;
  grid-gap: 0 1rem;
  grid-template-columns: repeat(3, 1fr);
}

.localization-item-content > label {
  grid-column: 1 / 2;
  padding-top: 1.6rem;
  text-align: right;
}

.localization-item-content > select {
  grid-column: 2 / 4;
}

.update-item {
  padding: 2rem;
}

:root .update-checkbox,
:root .network-checkbox,
:root .user-checkbox,
:root .developer-checkbox,
:root .experiment-checkbox {
  /* original check box is pushed outside the viewport */
  position: absolute;
  left: -1000em;
}

#network-settings-wifi-show-password + label:before {
  float: none;
  margin: -1rem 1rem -1rem -0.5rem;
}

#network-settings-wlan-show-password-wrap span,
#network-settings-wifi .network-settings-wrap span {
  width: 14rem;
  display: inline-block;
  text-align: left;
}

#network-settings-wlan-show-password-wrap span {
  margin-left: -2rem;
}

#edit-user-form span {
  max-width: calc(100% - 4rem);
  display: inline-block;
  text-align: left;
  position: relative;
  top: -1.6rem;
}

:root .network-checkbox + label:before {
  content: "";
  display: inline-block;
  width: 3rem;
  height: 3rem;
  float: left;
  margin: 1rem;
  background: url("/images/checkbox-sprite.png") no-repeat 0 0;
  background-size: 3rem auto;
}

:root .user-checkbox + label:before {
  content: "";
  display: inline-block;
  width: 3rem;
  height: 3rem;
  margin: 1rem 1rem 1rem -1rem;
  background: url("/images/checkbox-sprite.png") no-repeat 0 0;
  background-size: 3rem auto;
}

:root .update-checkbox + label:before,
:root .developer-checkbox + label:before,
:root .experiment-checkbox + label:before {
  content: "";
  display: inline-block;
  width: 3rem;
  height: 3rem;
  float: right;
  margin-top: -0.25rem;
  background: url("/images/checkbox-sprite.png") no-repeat 0 0;
  background-size: 3rem auto;
}

:root .update-checkbox:checked + label:before,
:root .network-checkbox:checked + label:before,
:root .user-checkbox:checked + label:before,
:root .developer-checkbox:checked + label:before,
:root .experiment-checkbox:checked + label:before {
  background-position: 0 -3rem;
}

:root .update-checkbox:disabled + label:before,
:root .network-checkbox:disabled + label:before,
:root .user-checkbox:disabled + label:before,
:root .developer-checkbox:disabled + label:before,
:root .experiment-checkbox:disabled + label:before {
  background-position: 0 -6rem;
}

:root .update-checkbox:checked:disabled + label:before,
:root .network-checkbox:checked:disabled + label:before,
:root .user-checkbox:checked:disabled + label:before,
:root .developer-checkbox:checked:disabled + label:before,
:root .experiment-checkbox:checked:disabled + label:before {
  background-position: 0 -9rem;
}

#enable-self-updates-checkbox + label:before,
#domain-settings-local-checkbox + label:before {
  float: none;
  vertical-align: middle;
  margin-right: 0.5rem;
}

#enable-ssh-item {
  background-image: url('/images/ssh-icon.svg');
}

/* Uncomment this and change "example" to add a new experiment */
/*
#example-experiment-item {
  background-image: url('/images/example-icon.svg');
}
*/

#view-internal-logs {
  background-image: url('/images/rules-icon.png');
}

#new-local-authorization {
  background-image: url('/images/authorization.svg');
}

#update-now.hidden {
  display: none;
}

#localization-settings > .settings-container,
#update-settings > .settings-container {
  font-size: 1.8rem;
}

#up-to-date-container {
  display: flex;
  justify-content: space-between;
}

#update-now {
  font-size: 1.8rem;
  padding: 1.8rem;
  margin-left: 1rem;
  background: #305067;
}

#update-settings-up-to-date {
}

.authorization-item {
  position: relative;
  padding-left: 12rem;
  background-image: url('/images/authorization.svg');
  background-size: 8rem auto;
  background-repeat: no-repeat;
  background-position: left 2rem center;
}

#no-authorizations {
  background-image: none;
  padding-left: 5.5rem;
}

.revoke-button {
  position: absolute;
  right: 2rem;
  padding-left: 2.8rem;
  font-size: 1.8rem;
  top: 50%;
  transform: translateY(-50%);
  background-color: #48779a;

  background-image: url('/images/stop-16.svg');
  background-position: 1rem;
  background-size: 1.2rem;
  background-repeat: no-repeat;
}

.origin {
  color: rgba(255, 255, 255, 0.7);
}

.user-form {
  top: 50%;
  transform: translateY(-50%);
  position: relative;
  text-align: center;
  font-size: 1.6rem;
  width: 50%;
  min-width: 28rem;
  max-width: 38rem;
  margin: 0 auto;
  max-height: 100%;
}

.network-settings-wrap {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  top: 50%;
  transform: translateY(calc(-50% - 6rem));
  position: relative;
  text-align: center;
  font-size: 1.6rem;
  width: 100%;
  max-width: 60rem;
  margin: 0 auto;
  max-height: 100%;
}

#network-settings-wifi .network-settings-wrap {
  display: block;
}

#network-settings-wifi .network-settings-wrap button {
  margin: 3rem auto;
}

#network-settings-wifi .network-settings-wrap input {
  margin: 1rem auto;
}

.network-settings-wrap label:not(.checkbox),
.network-settings-wrap span {
  font-size: 1.6rem;
  color: #fff;
  margin-top: 1.4rem;
  text-align: right;
}

.network-button {
  display: block;
  grid-column: 2 / 3;
  margin: 2rem auto 1rem 1rem;
}

.wireless-network-item {
  text-align: left;
  height: 7rem;
}

.wireless-network-item:hover {
  background-color: #658196;
}

.wireless-network-info {
  display: inline-block;
  width: calc(100% - 8.8rem);
  padding-left: 1.8rem;
  text-align: left;
  line-height: 7rem;
}

.wireless-network-info.configured {
  line-height: 3rem;
  padding-top: 0.5rem;
}

.wireless-network-info-connected {
  color: #8dd35f !important;
}

.wireless-network-info-disconnected {
  color: #ff9955 !important;
}

.wireless-network-icon {
  position: relative;
  right: 1.8rem;
  top: 1.8rem;
  height: 3.4rem;
  float: right;
}

.network-settings-wrap input[type="password"],
.network-settings-wrap input[type="text"],
.network-select,
.user-form input {
  display: block;
  width: 18rem;
  margin: 1rem;
}

.localization-select {
  display: block;
  width: calc(100% - 1rem);
  max-width: 30rem;
  margin: 1rem;
}

.user-settings-save {
  display: block;
  margin: 1rem auto;
}

.user-form .error {
  color: #ff9955;
}

.network-settings-wrap input[type="text"],
.network-settings-wrap input[type="password"],
.user-form input[type="text"],
.user-form input[type="password"],
.user-form input[type="email"] {
  height: 2.3rem;
  background-color: #d2d9de;
  border: none;
  border-radius: 0.5rem;
  padding: 0.5rem;
}

.user-form input[type="text"],
.user-form input[type="password"],
.user-form input[type="email"] {
  margin: 1rem auto;
}

.network-button,
.user-form button {
  font-size: 1.6rem;
  background-color: #597285;
  border: none;
  border-radius: 0.5rem;
  padding: 1rem 4rem;
  color: #fff;
}

.network-button:hover,
.network-button:active,
.user-form button:hover,
.user-form button:active {
  background-color: #658196;
}

.network-button::-moz-focus-inner,
.user-form button::-moz-focus-inner {
  border: 0;
}

.network-button:disabled {
  background-color: #597285;
  opacity: 0.5;
}

.network-settings-wrap .hidden,
.user-form .hidden {
  display: none !important;
}

.localization-select,
.network-select {
  display: inline-block;
  text-align: left;
  color: #fff;
  background-color: #597285;
  font-size: 1.5rem;
  border: none;
  border-radius: 0.5rem;
  height: 4rem;
  -moz-appearance: none;
  -webkit-appearance: none;
  appearance: none;
  background-image: url('/images/select-arrow.svg');
  background-repeat: no-repeat;
  background-size: 1.25rem;
  background-position: calc(100% - 1rem);
  padding-left: 1rem;
}

.localization-select:disabled,
.network-select:disabled {
  background-color: #48779a;
}

#network-settings-wlan-show-password-wrap {
  grid-column: 2 / 3;
}

#edit-user-form {
  color: #fff;
}

#user-settings-mfa {
  padding-top: 4rem;
}

#user-settings-mfa-secret {
  word-break: break-all;
}

#user-settings-mfa-qr-code {
  padding: 2rem 0 2rem 0;
}

#user-settings-mfa-secret {
  padding-bottom: 4rem;
}

#user-settings-mfa-error {
  padding-bottom: 1rem;
}

#user-settings-mfa-verify {
  margin-bottom: 2rem;
}

#user-settings-mfa-backup-codes-message {
  padding: 1rem 0;
}

#user-settings-mfa-backup-codes {
  padding-bottom: 2rem;
}

#user-settings-mfa-backup-codes > p {
  margin: 0.1rem 0;
}
